﻿namespace Jim.OA.Service;

/// <summary>
/// 可创建流程
/// </summary>
/// <remarks>查询某个用户可用流程以及分类</remarks>  
[ApiDescriptionSettings(ApplicationConst.GroupName)]
public  class OAWorkflowService : IDynamicApiController, ITransient
{
    private readonly OAClientFactory _oaClientFactory;

    public OAWorkflowService(OAClientFactory oaClientFactory)
    {
        _oaClientFactory = oaClientFactory;
    }


    /// <summary>
    /// 获取可创建流程类型列表数量
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestCountOutput> GetCreateWorkflowTypeCount([FromQuery] OAGetCreateWorkflowTypeCountInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }
    /// <summary>
    /// 获取可创建流程类型列表
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetCreateWorkflowTypeListOutput> GetCreateWorkflowTypeList([FromQuery] OAGetCreateWorkflowTypeListInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }
    /// <summary>
    /// 获取可创建的流程数据数量
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetRequestCountOutput> GetCreateWorkflowCount([FromQuery] OAGetCreateWorkflowCountInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

    /// <summary>
    /// 获取可创建的流程数据列表
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [NonUnify]
    public async Task<OAGetCreateWorkflowListOutput> GetCreateWorkflowList([FromQuery] OAGetCreateWorkflowListInput input)
    {
        var client = _oaClientFactory.CreateRestClient();
        client.IsDebug = true;
        var result = await client.Execute(input);
        return result;
    }

}
